from selenium import webdriver
import time

# Created with pycharm
# author:ju bai
# Date:2021/7/20
# Time:8:55
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()
# # 打开禅道
# # driver.get("http://127.0.0.1:88/index.php")
# # 打开禅道登录页面
# driver.get("http://127.0.0.1:88/zentao/user-login-L3plbnRhby8=.html")
# driver.find_element_by_id("account").send_keys("admin")
# # tab键
# driver.find_element_by_id("account").send_keys(Keys.TAB)
# # driver.find_element_by_name("password").send_keys("WYMwym0119")
#
# # Enter键登录
# driver.find_element_by_name("password").send_keys(Keys.ENTER)
# # driver.find_element_by_id("submit").click()

driver.get("https://www.baidu.com/")
driver.find_element_by_id("kw").send_keys("姜云升")
driver.find_element_by_id("su").click()

time.sleep(6)

# 组合键盘示例
driver.find_element_by_id("kw").send_keys(Keys.CONTROL,'a')
time.sleep(3)
driver.find_element_by_id("kw").send_keys(Keys.CONTROL,'x')
time.sleep(3)
driver.find_element_by_id("kw").send_keys("自白书")
driver.find_element_by_id("su").click()

driver.quit()

